<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
 <%@ page contentType="text/html; charset=UTF-8" %>
<%@ page import="com.bstek.dorado.data.db.DBStatement" %>
<%@ page import="com.bstek.dorado.utils.variant.VariantSet" %>
<%@ page import="java.sql.Connection" %>
<%@ page import="java.sql.*" %>
<%@ page import="com.bstek.dorado.common.ds.ConnectionHelper" %>
<%@ page import="com.xr.common.CommUtil" %>
<%@ page import="oracle.sql.CLOB" %>
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
	<title> </title>
<META content="text/html; charset=utf-8" http-equiv="content-type" />
<META HTTP-EQUIV="pragma" CONTENT="no-cache">
<META HTTP-EQUIV="Cache-Control" CONTENT="no-cache, must-revalidate">
<META HTTP-EQUIV="expires" CONTENT="0">
<style id="styles" type="text/css">

		div.editable
		{
			border: solid 2px Transparent;
			padding-left: 15px;
			padding-right: 15px;
		}

		div.editable:hover
		{
			border-color: black;
		}

	</style>
<script type="text/javascript" src="../ckeditor/ckeditor.js"></script>
	 <script type="text/javascript">
		//<![CDATA[

			//CKEDITOR.replace( 'editor1',{width:900, height:360});
window.onload = function(){
	if ( window.addEventListener )
		document.body.addEventListener( 'dblclick', onDoubleClick, false );
	else if ( window.attachEvent )
		document.body.attachEvent( 'ondblclick', onDoubleClick );
};
function onDoubleClick( ev ){
	var element = ev.target || ev.srcElement;
	element = element.parentNode;
	//alert(element.className.indexOf( 'editable' ) );
	if ( element.nodeName.toLowerCase() == 'div' && ( element.className.indexOf( 'editable' ) != -1 ) )
	
		replaceDiv( element );
}
var editor;
function replaceDiv( div ){
	if ( editor )
		editor.destroy();
	editor = CKEDITOR.replace( div );
}
	//]]>
	</script>
</head>
<body>

<%
String ID=request.getParameter("functionId");
String tip="",content="",sysHelpId="";
 Connection connection = null;
String sql="select t.* from PB_SYS_HELP t where t.last_version=1 and t.function_id="+ID;
//System.out.println(sql);
	try {
            connection = ConnectionHelper.getConnection("");
            Statement st = connection.createStatement();
            ResultSet rs = st.executeQuery(sql);
            if(rs.next()){      
          
                tip=CommUtil.BlobToStr((CLOB)rs.getClob("TIP"));
                content=CommUtil.BlobToStr((CLOB)rs.getClob("DETAIL"));
               sysHelpId=rs.getString("SYS_HELP_ID");
              //   System.out.println(sysHelpId);
            }
            rs.close();
            st.close();
        }catch(Exception e){}finally {
                try {
                    connection.close();
                } catch (SQLException e) {
                }
        }
      if(tip==null||tip.equals("")){
        tip="<h4>提示部分</h4>";
      }
      if(content==null||content.equals("")){
        content="<h4>详细说明</h4>";
      }
%>
			<%--<textarea  cols="80" id="editor1" name="editor1" rows="30"> 
			 <%=content%>
			 </textarea>
	 --%>
	 
	<input type='hidden' id='sysHelpId' value='<%=sysHelpId%>'/>
	 <div id="tipEditor" class="editable">
			 <%=tip%>
	</div>
	<hr>
	<div id="detailEditor" class="editable">
			 <%=content%>
	</div>
	 
	 
	 
</body>
</html>
